/**
 * 弹出层配置选项接口
 */
export interface AirdropModalOptions {
  // 容器选择器或DOM元素
  container?: string | HTMLElement;
  // 模态框主题：'light' | 'dark' | 'auto'
  theme?: string;
  // 是否启用拖拽
  enableDrag?: boolean;
  // 自定义类名
  className?: string;
  // 自定义标题
  title?: string;
  // 应用名称
  appName?: string;
  // 应用Logo
  appLogo?: string;
  // 项目描述
  projectDesc?: string;
  // 代币符号
  coinSymbol?: string;
  // 结束日期
  endDate?: string;
  // 是否启用暗黑模式
  darkMode?: boolean;
  // 主题风格
  accentTheme?: string;
  // 父容器
  parent?: HTMLElement;
  // 是否在移动设备上启用拖动
  enableDragOnMobile?: boolean;
  // 是否自动初始化
  autoInit?: boolean;
  // 回调函数
  onOpen?: () => void;
  onClose?: () => void;
  onQuery?: (address: string) => Promise<boolean>;
  onClaim?: () => Promise<boolean>;
  onCancel?: () => void;
  onMoreInfo?: () => void;
  onCheck?: (address: string) => Promise<CheckResult>;
  onConnectWallet?: () => Promise<string>;
  // Add new theme-related options
  appLogoDefault?: string;
  appLogoCyber?: string;
  appLogoForest?: string;
  appLogoSunset?: string;
  appLogoOceanic?: string;
  appLogoMinty?: string;
  appLogoRoyalPurple?: string;
  appLogoCrimsonGold?: string;
  appLogoDeepSea?: string;
  logos?: {
    default?: string;
    cyber?: string;
    forest?: string;
    sunset?: string;
    oceanic?: string;
    minty?: string;
    royalpurple?: string;
    crimsongold?: string;
    deepsea?: string;
  };
}

/**
 * 检查结果接口
 */
export interface CheckResult {
  isEligible: boolean;
  amount?: string;
  usdValue?: string;
}

/**
 * 倒计时信息接口
 */
export interface CountdownInfo {
  days: string;
  hours: string;
  minutes: string;
  seconds: string;
}

/**
 * 主题配置接口
 */
export interface ThemeConfig {
  primary: ThemeColorConfig;
  secondary: ThemeColorConfig;
  success: ThemeColorConfig;
  error: ThemeColorConfig;
  warning?: ThemeColorConfig;
  loaderTop?: {
    DEFAULT: string;
  };
}

/**
 * 主题颜色配置接口
 */
export interface ThemeColorConfig {
  DEFAULT: string;
  rgb?: string;
  textOn?: string;
  shadow?: string;
  particle?: string;
}

/**
 * 可用的主题类型
 */
export type AccentThemeType = 
  | 'theme-web3'
  | 'theme-cyberpunk'
  | 'theme-forest'
  | 'theme-sunset'
  | 'theme-oceanic'
  | 'theme-minty'
  | 'theme-royalpurple'
  | 'theme-crimsongold'
  | 'theme-deepsea';

/**
 * 组件状态类型
 */
export type StateType = 'query' | 'loading' | 'success' | 'failure';

/**
 * 内置主题配置
 */
export const DEFAULT_THEMES: Record<string, ThemeConfig> = {
  web3: {
    primary: { 
      DEFAULT: '#2563EB', 
      rgb: '37, 99, 235', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(37,99,235,0.3)' 
    },
    secondary: { 
      DEFAULT: 'rgba(224, 231, 255, 0.7)', 
      textOn: '#1E3A8A' 
    },
    success: { 
      DEFAULT: '#10B981', 
      particle: '#34D399', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(16,185,129,0.3)' 
    },
    error: { 
      DEFAULT: '#EF4444', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(239,68,68,0.3)' 
    },
    warning: { 
      DEFAULT: '#F59E0B', 
      textOn: '#1F2937', 
      shadow: 'rgba(245,158,11,0.3)' 
    },
    loaderTop: { 
      DEFAULT: '#2563EB' 
    }
  },
  cyberpunk: {
    primary: { 
      DEFAULT: '#00F0FF', 
      rgb: '0, 240, 255', 
      textOn: '#0C0C1A', 
      shadow: 'rgba(0,240,255,0.4)' 
    },
    secondary: { 
      DEFAULT: 'rgba(61, 61, 126, 0.7)', 
      textOn: '#E0E0FF' 
    },
    success: { 
      DEFAULT: '#00FF7F', 
      particle: '#00FF7F', 
      textOn: '#0C0C1A', 
      shadow: 'rgba(0,255,127,0.4)' 
    },
    error: { 
      DEFAULT: '#FF4D4D', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(255,77,77,0.4)' 
    },
    warning: { 
      DEFAULT: '#FFD700', 
      textOn: '#0C0C1A', 
      shadow: 'rgba(255,215,0,0.4)' 
    },
    loaderTop: { 
      DEFAULT: '#00F0FF' 
    }
  },
  forest: {
    primary: { 
      DEFAULT: '#228B22', 
      rgb: '34, 139, 34', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(34,139,34,0.3)' 
    },
    secondary: { 
      DEFAULT: 'rgba(233, 245, 233, 0.7)', 
      textOn: '#166534' 
    },
    success: { 
      DEFAULT: '#34D399', 
      particle: '#34D399', 
      textOn: '#064E3B', 
      shadow: 'rgba(52,211,153,0.3)' 
    },
    error: { 
      DEFAULT: '#DC2626', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(220,38,38,0.3)' 
    },
    warning: { 
      DEFAULT: '#FACC15', 
      textOn: '#422006', 
      shadow: 'rgba(250,204,21,0.3)' 
    },
    loaderTop: { 
      DEFAULT: '#228B22' 
    }
  },
  sunset: {
    primary: { 
      DEFAULT: '#F97316', 
      rgb: '249, 115, 22', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(249,115,22,0.3)' 
    },
    secondary: { 
      DEFAULT: 'rgba(255, 247, 237, 0.7)', 
      textOn: '#C2410C' 
    },
    success: { 
      DEFAULT: '#EA580C', 
      particle: '#FDBA74', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(234,88,12,0.3)' 
    },
    error: { 
      DEFAULT: '#BE123C', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(190,18,60,0.3)' 
    },
    warning: { 
      DEFAULT: '#F59E0B', 
      textOn: '#451A03', 
      shadow: 'rgba(245,158,11,0.3)' 
    },
    loaderTop: { 
      DEFAULT: '#F97316' 
    }
  },
  oceanic: {
    primary: { 
      DEFAULT: '#0E7490', 
      rgb: '14, 116, 144', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(14,116,144,0.3)' 
    },
    secondary: { 
      DEFAULT: 'rgba(236, 254, 255, 0.7)', 
      textOn: '#155E75' 
    },
    success: { 
      DEFAULT: '#059669', 
      particle: '#34D399', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(5,150,105,0.3)' 
    },
    error: { 
      DEFAULT: '#BE185D', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(190,24,93,0.3)' 
    },
    warning: { 
      DEFAULT: '#CA8A04', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(202,138,4,0.3)' 
    },
    loaderTop: { 
      DEFAULT: '#0E7490' 
    }
  },
  minty: {
    primary: { 
      DEFAULT: '#10B981', 
      rgb: '16, 185, 129', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(16,185,129,0.3)'
    },
    secondary: { 
      DEFAULT: 'rgba(209, 250, 229, 0.7)', 
      textOn: '#065F46' 
    },
    success: { 
      DEFAULT: '#059669', 
      particle: '#34D399', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(5,150,105,0.3)' 
    },
    error: { 
      DEFAULT: '#EF4444', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(239,68,68,0.3)' 
    },
    warning: { 
      DEFAULT: '#F59E0B', 
      textOn: '#451A03', 
      shadow: 'rgba(245,158,11,0.3)' 
    },
    loaderTop: { 
      DEFAULT: '#10B981' 
    }
  },
  royalpurple: {
    primary: { 
      DEFAULT: '#7E22CE', 
      rgb: '126, 34, 206', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(126,34,206,0.3)' 
    },
    secondary: { 
      DEFAULT: 'rgba(243, 232, 255, 0.7)', 
      textOn: '#581C87' 
    },
    success: { 
      DEFAULT: '#65A30D', 
      particle: '#A3E635', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(101,163,13,0.3)' 
    },
    error: { 
      DEFAULT: '#BE123C', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(190,18,60,0.3)' 
    },
    warning: { 
      DEFAULT: '#D97706', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(217,119,6,0.3)' 
    },
    loaderTop: { 
      DEFAULT: '#7E22CE' 
    }
  },
  crimsongold: {
    primary: { 
      DEFAULT: '#DC143C', 
      rgb: '220, 20, 60', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(220,20,60,0.3)' 
    },
    secondary: { 
      DEFAULT: 'rgba(255, 248, 220, 0.7)', 
      textOn: '#8B0000' 
    },
    success: { 
      DEFAULT: '#FFD700', 
      particle: '#FFDF00', 
      textOn: '#4B0082', 
      shadow: 'rgba(255,215,0,0.3)' 
    },
    error: { 
      DEFAULT: '#B22222', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(178,34,34,0.3)' 
    },
    warning: { 
      DEFAULT: '#FFA500', 
      textOn: '#4B0082', 
      shadow: 'rgba(255,165,0,0.3)' 
    },
    loaderTop: { 
      DEFAULT: '#DC143C' 
    }
  },
  deepsea: {
    primary: { 
      DEFAULT: '#1E90FF', 
      rgb: '30, 144, 255', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(30,144,255,0.3)' 
    },
    secondary: { 
      DEFAULT: 'rgba(240, 248, 255, 0.7)', 
      textOn: '#00008B' 
    },
    success: { 
      DEFAULT: '#20B2AA', 
      particle: '#48D1CC', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(32,178,170,0.3)' 
    },
    error: { 
      DEFAULT: '#FF6347', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(255,99,71,0.3)' 
    },
    warning: { 
      DEFAULT: '#FF8C00', 
      textOn: '#FFFFFF', 
      shadow: 'rgba(255,140,0,0.3)' 
    },
    loaderTop: { 
      DEFAULT: '#1E90FF' 
    }
  }
};

export interface CountdownOptions {
  duration: number; // 倒计时时长，单位：秒
  onComplete: () => void;
}

export enum ModalStatus {
  QUERY = 'query',
  LOADING = 'loading',
  SUCCESS = 'success',
  FAILURE = 'failure'
}

export interface TemplateData {
  title?: string;
  message?: string;
  countdownTime?: string;
  [key: string]: any;
} 